<template>
    <el-row type="flex" class="row-bg" justify="center">
        <div class="title-container">
            <h3 class="title">欢迎使用泽浩管理软件平台</h3>
        </div>
        <el-col :xl="6" :lg="7">
            <el-card shadow="always" class="card">
                <el-form :model="changeForm" :rules="rules" ref="changeForm" label-width="80px" class="form_fa"
                    @keyup.enter.native="submitForm('changeForm')">
                    <el-form-item label="原密码" prop="password" style="width: 100%">
                        <el-input v-model="changeForm.userName"></el-input>
                    </el-form-item>
                    <el-form-item label="新密码" prop="newPassword" style="width: 100%">
                        <el-input v-model="changeForm.newPassword" type="password"></el-input>
                    </el-form-item>


                    <el-form-item>
                        <el-button type="primary" @click="submitForm" style="width: 100%">修改密码</el-button>
                    </el-form-item>

                </el-form>
            </el-card>
        </el-col>
    </el-row>
</template>
  
<script>
import qs from "qs";

export default {
    name: "changePassword",
    data() {
        return {
            changeForm: {
                userName: "",
                newPassword: "",

            },
            rules: {
                userName: [
                    { required: true, message: "请输入用户名", trigger: "blur" },
                ],
                newPassword: [{ required: true, message: "请输入密码", trigger: "blur" }],
            },
            captchaImg: undefined,
        };
    },
    created() {



    },
    methods: {

        submitForm() {
            this.$axios
                .post('/user/updatePassword', this.changeForm)
                .then((res) => {
                    console.log("changePassword", res)
                })
        },



    },
};
</script>
  
<style scoped>
.form_fa>>>.el-form-item__label {
    color: #fff;
}

.el-button {
    width: 130px;
    height: 40px;
    font-size: 1em;
    font-weight: bold;
    background-color: #293140;
    border: 3px #3bb6f4 solid;
    margin: auto;
    color: #3bb6f4;
}

.el-button:hover {
    background-color: #156cd2;
    color: #fff;
}

.card {
    background-color: rgba(130, 187, 232, 0.1);
    border: none;
}

.title {
    font-size: 26px;
    color: white;
    margin: 0px 30px 40px 30px;
    text-align: center;
    font-weight: bold;
    display: inline-block;
}

.el-row {
    background-image: url("../assets/back.png");
    background-size: 100%;
    background-repeat: no-repeat;
    color: #fff;
    height: 100%;
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.captchaImg {
    float: left;
    margin-left: 8px;
    border-radius: 4px;
}
</style>